

def read_data_by_column(filename: str, column: int, to_which_type: type = int):
    if column < 0:
        raise ValueError("column must greater than zero")
    result = []
    try:
        with open(filename, 'r') as f:
            for line in f.readlines():
                temp_line = line.split()
                if len(temp_line) < column+1:
                    continue
                try:
                    result.append(to_which_type(temp_line[column].strip()))
                except:
                    pass
    except:
        return []
    return result
